<div style="padding-top: 15px;">
  <?php echo link_to('Nova poruka', 'poruka/nova') ?>
  <?php echo link_to('Poslate poruke', 'poruka/poslate') ?>
</div>

<ul>
<?php foreach($porukas as $poruka)
{
   if($poruka->getPorukaId())
     $naslov = $poruka->getColumn('GlNaslov');
   else $naslov = $poruka->getNaslov();
?>
  <li><?php echo link_to($naslov, 'poruka/pregled?poruka_id='.$poruka->getId()).' - '.$poruka->getText().' / '.$poruka->getCreatedAt() ?></li>
<?php }?>
</ul>